/*
 * Copyright (C) 2012, EADS France
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */
package xowl.gmi.controller;

/**
 *
 * @author Laurent WOUTERS
 */
public class GraphNodeSetPosition extends NodeAction {
    private java.awt.Point location;
    
    public GraphNodeSetPosition(xowl.interpreter.Repository repository, String parent, String child, java.awt.Point location) {
        super("Positioning element", repository, parent, child);
        this.location = location;
    }
    
    @Override public void execute() {
        xowl.gmi.model.ast.Decorator decorator = getDecorator();
        decorator.setPositionX(location.x);
        decorator.setPositionY(location.y);
    }
    @Override public void undo() { }
    @Override public void redo() { execute(); }
}
